var app = angular.module("registerApp", [])
app.controller("registerController", function($scope, $http) {
	
	
	$scope.onClickregister = function() {
		
		$http({
			method : 'POST',
			url : '/life/123register112312412',
			params : {
				"name" : $scope.user,
				"password" : $scope.password,
				"email" : $scope.email,
				"phone" : $scope.phone,
				"classNumber":$scope.classNumber,
				"type":$scope.userType
			}
		}).then(function successCallback(response) {
			
			//alert(response.data.rs);
			if (response.data.rs=="Y" ) {
				
				window.location.href = "http://www.zizai.pro/life/Jump";//跳转到用户原本准备去的网页
			} else if (response.data.rs == "N") {
				//alert("???")
				$scope.errorMsg = "用户名已存在";
				$('#myModal').modal('show')
				
			}
		}, function errorCallback(response) {
			//var result = response.data.rs;
			
			alert("?????")
			
		});

	}
	
	
})